using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._SpatialAnalystTools._Neighborhood
{
    /// <summary>
    /// <para>Point Statistics</para>
    /// <para>Calculates a statistic on the points in a neighborhood around each output cell.</para>
    /// <para>计算每个输出像元周围邻域中点的统计数据。</para>
    /// </summary>    
    [DisplayName("Point Statistics")]
    public class PointStatistics : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public PointStatistics()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_point_features">
        /// <para>Input point features</para>
        /// <para><xdoc>
        ///   <para>The input point features for which to calculate the statistics in a neighborhood around each output cell.</para>
        ///   <para>The input can be either a point or multipoint feature class.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>用于计算每个输出像元周围邻域中统计数据的输入点要素。</para>
        ///   <para>输入可以是点要素类，也可以是多点要素类。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_field">
        /// <para>Field</para>
        /// <para><xdoc>
        ///   <para>The field for which the specified statistic will be calculated. It can be any numeric field of the input features.</para>
        ///   <para>It can be the Shape field if the input features contain z-values.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>将为其计算指定统计数据的字段。它可以是输入要素的任意数值字段。</para>
        ///   <para>如果输入要素包含 z 值，则它可以是形状字段。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_out_raster">
        /// <para>Output raster</para>
        /// <para>The output point statistics raster.</para>
        /// <para>输出点统计栅格。</para>
        /// </param>
        public PointStatistics(object _in_point_features, object _field, object _out_raster)
        {
            this._in_point_features = _in_point_features;
            this._field = _field;
            this._out_raster = _out_raster;
        }
        public override string ToolboxName => "Spatial Analyst Tools";

        public override string ToolName => "Point Statistics";

        public override string CallName => "sa.PointStatistics";

        public override List<string> AcceptEnvironments => ["autoCommit", "cellSize", "cellSizeProjectionMethod", "compression", "configKeyword", "extent", "geographicTransformations", "outputCoordinateSystem", "scratchWorkspace", "snapRaster", "tileSize", "workspace"];

        public override object[] ParameterInfo => [_in_point_features, _field, _out_raster, _cell_size, _neighborhood, _statistics_type.GetGPValue()];

        /// <summary>
        /// <para>Input point features</para>
        /// <para><xdoc>
        ///   <para>The input point features for which to calculate the statistics in a neighborhood around each output cell.</para>
        ///   <para>The input can be either a point or multipoint feature class.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>用于计算每个输出像元周围邻域中统计数据的输入点要素。</para>
        ///   <para>输入可以是点要素类，也可以是多点要素类。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input point features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_point_features { get; set; }


        /// <summary>
        /// <para>Field</para>
        /// <para><xdoc>
        ///   <para>The field for which the specified statistic will be calculated. It can be any numeric field of the input features.</para>
        ///   <para>It can be the Shape field if the input features contain z-values.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>将为其计算指定统计数据的字段。它可以是输入要素的任意数值字段。</para>
        ///   <para>如果输入要素包含 z 值，则它可以是形状字段。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Field")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _field { get; set; }


        /// <summary>
        /// <para>Output raster</para>
        /// <para>The output point statistics raster.</para>
        /// <para>输出点统计栅格。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_raster { get; set; }


        /// <summary>
        /// <para>Output cell size</para>
        /// <para><xdoc>
        ///   <para>The cell size of the output raster that will be created.</para>
        ///   <para>This parameter can be defined by a numeric value or obtained from an existing raster dataset. If the cell size hasn't been explicitly specified as the parameter value, the environment cell size value will be used if specified; otherwise, additional rules will be used to calculate it from the other inputs. See the usage section for more detail.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>将创建的输出栅格的像元大小。</para>
        ///   <para>此参数可以由数值定义，也可以从现有栅格数据集中获取。如果尚未将像元大小显式指定为参数值，则在指定的情况下将使用环境像元大小值;否则，将使用其他规则从其他输入计算它。有关详细信息，请参阅用法部分。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output cell size")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _cell_size { get; set; } = null;


        /// <summary>
        /// <para>Neighborhood</para>
        /// <para><xdoc>
        ///   <para>The area around each processing cell within which any input points found will be used in the statistics calculation. There are several predefined neighborhood types to choose from.</para>
        ///   <para>Once the neighbourhood type is selected, other parameters can be set to fully define the shape, size and units of measure. The default neighborhood is a rectangle.</para>
        ///   <para>The following are the forms of the available neighborhood types:</para>
        ///   <bulletList>
        ///     <bullet_item>Annulus, Inner radius, Outer radius, Units type
        ///     <para>A torus (donut-shaped) neighborhood defined by an inner radius and an outer radius. The default annulus is an inner radius of one cell and an outer radius of three cells.</para>
        ///     </bullet_item><para/>
        ///     <bullet_item>Circle, Radius, Units type
        ///     <para>A circular neighborhood with the given radius. The default radius is three cells.</para>
        ///     </bullet_item><para/>
        ///     <bullet_item>Rectangle, Height, Width, Units type
        ///     <para>A rectangular neighborhood defined by height and width. The default is a square with a height and width of three cells.</para>
        ///     </bullet_item><para/>
        ///     <bullet_item>Wedge, Radius, Start angle, End angle, Units type
        ///     <para>A wedge-shaped neighborhood defined by a radius, the start angle, and the end angle. The wedge extends counterclockwise from the starting angle to the ending angle. Angles are specified in degrees, with 0 or 360 representing east. Negative angles can be used. The default wedge is from 0 to 90 degrees, with a radius of three cells.</para>
        ///     </bullet_item><para/>
        ///   </bulletList>
        ///   <para>The distance units for the parameters can be specified in Cell units or Map units. Cell units is the default.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>每个处理单元周围的区域，在统计计算中将使用在其中找到的任何输入点。有几种预定义的邻域类型可供选择。</para>
        ///   <para>选择邻域类型后，可以设置其他参数以完全定义形状、大小和测量单位。默认邻域为矩形。</para>
        ///   <para>以下是可用邻域类型的形式：</para>
        ///   <bulletList>
        /// <bullet_item>环形， 内半径， 外半径， 单位类型
        ///     <para>由内半径和外半径定义的环面（甜甜圈形）邻域。默认环形是一个像元的内半径和三个像元的外半径。</para>
        ///     </bullet_item><para/>
        /// <bullet_item>圆、半径、单位类型
        ///     <para>具有给定半径的圆形邻域。默认半径为三个像元。</para>
        ///     </bullet_item><para/>
        /// <bullet_item>矩形、高度、宽度、单位类型
        ///     <para>由高度和宽度定义的矩形邻域。默认值为高度和宽度为三个单元格的正方形。</para>
        ///     </bullet_item><para/>
        /// <bullet_item>楔块、半径、起始角度、端角、单位类型
        ///     <para>由半径、起始角和结束角定义的楔形邻域。楔块从起始角逆时针延伸到结束角。角度以度为单位指定，0 或 360 表示东。可以使用负角。默认楔块为 0 到 90 度，半径为 3 个像元。</para>
        ///     </bullet_item><para/>
        ///   </bulletList>
        ///   <para>参数的距离单位可以在像元单位或地图单位中指定。单元单位是默认值。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Neighborhood")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _neighborhood { get; set; } = null;


        /// <summary>
        /// <para>Statistics type</para>
        /// <para><xdoc>
        ///   <para>Specifies the statistic type to be calculated.</para>
        ///   <para>The calculation is performed on the values of the specified field of the points that fall within the specified neighborhood of each output raster cell.</para>
        ///   <bulletList>
        ///     <bullet_item>Mean—The average of the field values in each neighborhood will be calculated.</bullet_item><para/>
        ///     <bullet_item>Majority—The most frequently occurring field value in each neighborhood will be identified. In the case of a tie, the lower value is used.</bullet_item><para/>
        ///     <bullet_item>Maximum—The largest field value in each neighborhood will be identified.</bullet_item><para/>
        ///     <bullet_item>Median—The median field value in each neighborhood will be calculated. In the case of an even number of points in the neighborhood, the result will be the lower of the two middle values.</bullet_item><para/>
        ///     <bullet_item>Minimum—The smallest field value in each neighborhood will be identified.</bullet_item><para/>
        ///     <bullet_item>Minority—The least frequently occurring field value in each neighborhood will be identified. In the case of a tie, the lower value is used.</bullet_item><para/>
        ///     <bullet_item>Range—The range (the difference between the largest and smallest) of the field values in each neighborhood will be calculated.</bullet_item><para/>
        ///     <bullet_item>Standard Deviation—The standard deviation of the field values in each neighborhood will be calculated.</bullet_item><para/>
        ///     <bullet_item>Sum—The sum of the field values in the neighborhood will be calculated.</bullet_item><para/>
        ///     <bullet_item>Variety—The number of unique field values in each neighborhood will be calculated.</bullet_item><para/>
        ///   </bulletList>
        ///   <para>The available choices for the statistics type is determined by the numeric type of the specified field. If the field is integer, all the statistics types are available. If the field is floating point, only the maximum, mean, minimum, range, standard deviation and sum statistics are available.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定要计算的统计信息类型。</para>
        ///   <para>计算的对象是位于每个输出栅格像元的指定邻域内的点的指定字段的值。</para>
        ///   <bulletList>
        ///     <bullet_item>均值—将计算每个邻域中字段值的平均值。</bullet_item><para/>
        ///     <bullet_item>多数 - 将识别每个邻域中出现频率最高的字段值。如果出现平局，则使用较低的值。</bullet_item><para/>
        ///     <bullet_item>最大值—将标识每个邻域中的最大字段值。</bullet_item><para/>
        ///     <bullet_item>中位数—将计算每个邻域中的中值字段值。如果邻域中的点数为偶数，则结果将是两个中间值中的较低值。</bullet_item><para/>
        ///     <bullet_item>最小值—将标识每个邻域中的最小字段值。</bullet_item><para/>
        ///     <bullet_item>少数 - 将识别每个邻域中出现频率最低的字段值。如果出现平局，则使用较低的值。</bullet_item><para/>
        ///     <bullet_item>范围—将计算每个邻域中字段值的范围（最大值和最小值之间的差值）。</bullet_item><para/>
        ///     <bullet_item>标准差—将计算每个邻域中字段值的标准差。</bullet_item><para/>
        ///     <bullet_item>Sum—将计算邻域中字段值的总和。</bullet_item><para/>
        ///     <bullet_item>多样性—将计算每个邻域中唯一字段值的数量。</bullet_item><para/>
        ///   </bulletList>
        ///   <para>统计类型的可用选项由指定字段的数值类型决定。如果字段为整数，则所有统计信息类型都可用。如果字段为浮点，则只有最大值、平均值、最小值、范围、标准差和总和统计数据可用。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Statistics type")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _statistics_type_value _statistics_type { get; set; } = _statistics_type_value._MEAN;

        public enum _statistics_type_value
        {
            /// <summary>
            /// <para>Mean</para>
            /// <para>Mean—The average of the field values in each neighborhood will be calculated.</para>
            /// <para>均值—将计算每个邻域中字段值的平均值。</para>
            /// </summary>
            [Description("Mean")]
            [GPEnumValue("MEAN")]
            _MEAN,

            /// <summary>
            /// <para>Majority</para>
            /// <para>Majority—The most frequently occurring field value in each neighborhood will be identified. In the case of a tie, the lower value is used.</para>
            /// <para>多数 - 将识别每个邻域中出现频率最高的字段值。如果出现平局，则使用较低的值。</para>
            /// </summary>
            [Description("Majority")]
            [GPEnumValue("MAJORITY")]
            _MAJORITY,

            /// <summary>
            /// <para>Maximum</para>
            /// <para>Maximum—The largest field value in each neighborhood will be identified.</para>
            /// <para>最大值—将标识每个邻域中的最大字段值。</para>
            /// </summary>
            [Description("Maximum")]
            [GPEnumValue("MAXIMUM")]
            _MAXIMUM,

            /// <summary>
            /// <para>Median</para>
            /// <para>Median—The median field value in each neighborhood will be calculated. In the case of an even number of points in the neighborhood, the result will be the lower of the two middle values.</para>
            /// <para>中位数—将计算每个邻域中的中值字段值。如果邻域中的点数为偶数，则结果将是两个中间值中的较低值。</para>
            /// </summary>
            [Description("Median")]
            [GPEnumValue("MEDIAN")]
            _MEDIAN,

            /// <summary>
            /// <para>Minimum</para>
            /// <para>Minimum—The smallest field value in each neighborhood will be identified.</para>
            /// <para>最小值—将标识每个邻域中的最小字段值。</para>
            /// </summary>
            [Description("Minimum")]
            [GPEnumValue("MINIMUM")]
            _MINIMUM,

            /// <summary>
            /// <para>Minority</para>
            /// <para>Minority—The least frequently occurring field value in each neighborhood will be identified. In the case of a tie, the lower value is used.</para>
            /// <para>少数 - 将识别每个邻域中出现频率最低的字段值。如果出现平局，则使用较低的值。</para>
            /// </summary>
            [Description("Minority")]
            [GPEnumValue("MINORITY")]
            _MINORITY,

            /// <summary>
            /// <para>Range</para>
            /// <para>Range—The range (the difference between the largest and smallest) of the field values in each neighborhood will be calculated.</para>
            /// <para>范围—将计算每个邻域中字段值的范围（最大值和最小值之间的差值）。</para>
            /// </summary>
            [Description("Range")]
            [GPEnumValue("RANGE")]
            _RANGE,

            /// <summary>
            /// <para>Standard Deviation</para>
            /// <para>Standard Deviation—The standard deviation of the field values in each neighborhood will be calculated.</para>
            /// <para>标准差—将计算每个邻域中字段值的标准差。</para>
            /// </summary>
            [Description("Standard Deviation")]
            [GPEnumValue("STD")]
            _STD,

            /// <summary>
            /// <para>Sum</para>
            /// <para>Sum—The sum of the field values in the neighborhood will be calculated.</para>
            /// <para>Sum—将计算邻域中字段值的总和。</para>
            /// </summary>
            [Description("Sum")]
            [GPEnumValue("SUM")]
            _SUM,

            /// <summary>
            /// <para>Variety</para>
            /// <para>Variety—The number of unique field values in each neighborhood will be calculated.</para>
            /// <para>多样性—将计算每个邻域中唯一字段值的数量。</para>
            /// </summary>
            [Description("Variety")]
            [GPEnumValue("VARIETY")]
            _VARIETY,

        }

        public PointStatistics SetEnv(int? autoCommit = null, object cellSize = null, object compression = null, object configKeyword = null, object extent = null, object geographicTransformations = null, object outputCoordinateSystem = null, object scratchWorkspace = null, object snapRaster = null, double[] tileSize = null, object workspace = null)
        {
            base.SetEnv(autoCommit: autoCommit, cellSize: cellSize, compression: compression, configKeyword: configKeyword, extent: extent, geographicTransformations: geographicTransformations, outputCoordinateSystem: outputCoordinateSystem, scratchWorkspace: scratchWorkspace, snapRaster: snapRaster, tileSize: tileSize, workspace: workspace);
            return this;
        }

    }

}